import { defineStore } from 'pinia'
import { isMobileTerminal } from '@/utils/flexible'

export const useSystemStore = defineStore('system', {
  state: () => ({
    currentTheme: 'sun',
    routerType: 'none'
  }),
  actions: {},
  getters: {
    themeClass: (state) =>
      state.currentTheme === 'sun' ? 'light-theme' : 'dark-theme',
    routerTypeGetter: (state) => {
      // PC端 永远没有跳转动画
      if (!isMobileTerminal.value) return 'none'
      return state.routerType
    }
  }
})
